/**
 * Copyright &copy; 2016-2017 <a href="https://www.lczyfz.com">联创智云</a> All rights reserved.
 */
package com.lczyfz.campusinfo.modules.user.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.lczyfz.campusinfo.common.persistence.CrudDao;
import com.lczyfz.campusinfo.common.persistence.annotation.MyBatisDao;
import com.lczyfz.campusinfo.modules.sys.entity.User;
import org.springframework.security.access.method.P;

/**
 * 用户信息DAO接口
 * @author 陈维乾
 * @version 2018-03-31
 */
@MyBatisDao
public interface CampusinfoUserDao extends CrudDao<User> {

	public List<User> findAllUser();
	
	public int checkLoginName(String loginName);
	
	public int checkEamil(String email);

	public int checkEmailExceptUserId(@Param("email") String email,@Param("id") String userId);

	public int checkMobile(@Param("mobile") String mobile);

	public User getByMobile(@Param("mobile") String mobile);

	public int checkMobileExceptUserId(@Param("mobile") String mobile,@Param("userId") String userId);

	public int insertUser(User user);


	/**
	 * 根据微信openId查询用户
	 *
	 * @param user
	 * @return
	 */
	public User getByWeChatId(User user);

	public User getByOpenId(@Param("openId")String openId);

	public User getUserInfo(@Param("userId")String userId);

	public User getByIdAndGroupid(@Param("id")String id,@Param("groupId")String groupId);

	public int updatePasswordById(@Param("id")String id,@Param("passwordNew")String passwordNew);
	
	public int checkIdAndPassword(@Param("id")String id,@Param("password") String password);
	
	public int checkEmailByUserId(@Param("email") String email,@Param("id")String id);
	
	public int updateUserInfo(User user);
	
	public int checkVerifyUser(User user);

	public int isMobile(@Param("mobile") String mobile);

	public int updatePasswordByMobile(@Param("mobile")String mobile,@Param("passwordNew")String passwordNew);

	public int updateSchoolIdByUserId(@Param("msg")String msg,@Param("id")String userId);

	public int updateNameByUserId(@Param("msg")String msg,@Param("id")String userId);

	public int updateStuIdByUserId(@Param("msg")String msg,@Param("id")String userId);

	public int updateMobileByUserId(@Param("msg")String msg,@Param("id")String userId);

	public int updateEmailByUserId(@Param("msg")String msg,@Param("id")String userId);

	public int isUserByOpenid(@Param("openId")String openId);

	public String getMobileById(@Param("id")String id);

	public List<User> getWeiXinUser();

	public String getUserNameByOpenId(@Param("openId")String openId);

}